import os

def createTxt(root_dir, src_dir, target_dir, content):
    file_list = os.listdir(os.path.join(root_dir, src_dir))
    for file_name in file_list:
        pure_name = file_name.split(".")[0]
        with open(os.path.join(root_dir, target_dir, pure_name) + ".txt", "w")  as file:
            file.write(content)

root_dir = "datas/train2"
src_dir = "ants-img"
target_dir = "ants-label"

# createTxt(root_dir, src_dir, target_dir, "ants")
createTxt(root_dir, "bees-img", "bees-label", "bees")
